﻿using System;
using System.Collections;
using SmartMenu.Controllers;
using visinia.SmartEngine.Modules;

public partial class Modules_General_SmartMenu_Settings : WebSettingsModule
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Menus.DataSource = MenuController.GetMenus();
            Menus.DataTextField = "Name";
            Menus.DataValueField = "MenuId";
            Menus.DataBind();
            Menus.SelectedValue = (string)Settings["Menu"];
        }
    }

    public override void SaveSettings(Hashtable data)
    {
        AddSetting("Menu", (string)data["Menus"]);
    }
}
